<%inherit file="/base/index.html" />

<%namespace file="/base/collectionViews.html" name="collectionViews" import="*"/>
<%namespace file="/base/javascriptDefs.html" name="javascriptDefs" import="*"/>

<%def name="heading()">
    % if hasattr(c, 'browsing'):
    <h1 class="heading">Collections (${c.paginator.item_count})</h1>       
    % elif c.paginator.item_count == 1:
    <h1 class="heading">Collection Results: ${c.paginator.item_count} match</h1>
    % else:
    <h1 class="heading">Collection Results: ${c.paginator.item_count} matches</h1>
    % endif
</%def>


% if hasattr(c, 'browsing'):
 <p>Collections are documents that can represent stories and records of
 elicitations, among other things.  In the body of a Collection, you can refer
 to a Form and thereby embed a representation of it.</p>
% endif


% if len(c.paginator):

<p id="paginatorPager">${ c.paginator.pager('$link_first $link_previous $first_item to $last_item of $item_count $link_next $link_last') }</p>


% if not hasattr(c, 'browsing'):
 ${javascriptDefs.toggleLabelsJavaScript('fileTableRowLabel')}
 <a class="buttonLink" id="toggleRowLabelsButton" title="hide labels">-</a>
% endif


<div class="tableSpacerDivHalf"></div>


% if hasattr(c, 'browsing'):
 <table style="width:100%;">
  <tr>
   <th class="onethirdcell">Title</th>
   <th class="onethirdcell">Date Modified</th>
   <th class="onethirdcell">Type</th>
  </tr>
 % for collection in c.paginator:
    ${collectionViews.collectionViewReallyShort(collection)}
 % endfor
 </table>
% else:
 % for collection in c.paginator:
    ${collectionViews.collectionViewShort(collection)}
 % endfor
% endif


<p>${ c.paginator.pager('~2~') }</p>

% endif
